program ftpsvr;

{$mode objfpc}{$H+}

uses
  Interfaces, Forms, windows, FtpServerFrm;   //WidgetSet.AppHandle

{$R *.res}
var
  hMutex : HWND;
begin
  hMutex := CreateMutex(nil, false, 'FTPS_RUNONCE');
  if WaitForSingleObject(hMutex,0)<>WAIT_TIMEOUT then//程序没有被运行过
  begin
    Application.Title:='ftpserver';
    RequireDerivedFormResource:=True;
    Application.Initialize;
    Application.CreateForm(TFtpServerForm, FtpServerForm);
    SetWindowLong(Application.MainForm.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
    Application.Run;
  end;
end.

